<?php

class Model_Studnet
{
    protected $_id = null;

    protected $_name = null;

    public function __constructor($id, $name)
    {
        $this->_id = $id;
        $this->_name = $name;
    }

    static public function findById($id)
    {
        $db = Zend_Db_Table::getDefaultAdapter();
        $select = $db->select();
        $select->from('student')
            ->where('id = ?', $id);
        if ($row = $select->query()->fetch()) {
            $student = new self($row['id'], $row['name']);
            return $student;
        }

        return false;
    }

    public function getId()
    {
        return $this->_id;
    }
}